package com.hunttown.common.sharding.client.config;

import java.util.Collections;
import java.util.Map;

import org.springframework.util.CollectionUtils;

public class ShardConfig {
    private Map<String, TableConfig> tableConfig;

    public ShardConfig() {
    }

    public Map<String, TableConfig> getTableConfig() {
        if (CollectionUtils.isEmpty(this.tableConfig)) {
            this.tableConfig = Collections.emptyMap();
        }

        return Collections.unmodifiableMap(this.tableConfig);
    }

    public void setTableConfig(Map<String, TableConfig> tableConfig) {
        this.tableConfig = tableConfig;
    }
}